//
//  OilCarStatusListHeadView.m
//  Base_App
//
//  Created by Yutian Duan on 2019/6/20.
//  Copyright © 2019年 Wanwin. All rights reserved.
//

#import "OilCarStatusListHeadView.h"

@implementation OilCarStatusListHeadView

- (instancetype)initWithFrame:(CGRect)frame {
  self = [super initWithFrame:frame];
  if (self) {
    self.backgroundColor = DEF_BgColor;
    [self createViews];

  }
  return self;
}

- (void)createViews {


  UIView *contenView = [[UIView alloc] initWithFrame:self.bounds];
  contenView.backgroundColor = DEF_BgColor;
  [self addSubview:contenView];
  
  ///!
  UIView *phoneContentView = [[UIView alloc] initWithFrame:CGRectMake(0, 35, ScreenWidth, 80)];
  phoneContentView.backgroundColor = [UIColor whiteColor];
  [contenView addSubview:phoneContentView];
  ///
  UILabel *messageLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 5, phoneContentView.yt_width, 20)];
  messageLabel.font = [UIFont systemFontOfSize:11.0f];
  messageLabel.textAlignment = NSTextAlignmentCenter;
  messageLabel.textColor = [UIColor blackColor];
  [phoneContentView addSubview:messageLabel];
  
  ///
  UIImageView *phoneImage = [[UIImageView alloc] initWithFrame:CGRectMake(messageLabel.yt_centerX - 60, messageLabel.yt_bottom + 5, 18, 18)];
  phoneImage.contentMode = UIViewContentModeScaleAspectFit;
  [phoneContentView addSubview:phoneImage];
  
  UILabel *phoneLabel = [[UILabel alloc] initWithFrame:CGRectMake(phoneImage.yt_right + 5, phoneImage.yt_top - 1, 120, 20)];
  phoneLabel.textColor = DEF_RED;
  phoneLabel.font = [UIFont systemFontOfSize:20.0f];
  [phoneContentView addSubview:phoneLabel];
  
  ///
  _aboutButton = [[UIButton alloc] initWithFrame:CGRectMake(0, phoneLabel.yt_bottom + 5, 80, 20)];
  _aboutButton.titleLabel.font = [UIFont systemFontOfSize:9];
  [_aboutButton setTitleColor:DEF_GRAY forState:UIControlStateNormal];
  _aboutButton.yt_centerX = phoneContentView.yt_centerX;
  [phoneContentView addSubview:_aboutButton];
  
  
  
  NSString *desStr = [NSString stringWithFormat:@"%@:",YTLocalizedString(@"请保持电话畅通，我们将透过以下号码来电进行资料核对")];
  messageLabel.text = desStr;
  
  phoneImage.image = [UIImage imageNamed:@"Setting_Phone"];
  phoneLabel.text = @"3166-6550";
  
  NSDictionary *styleDic = @{
                             NSUnderlineStyleAttributeName:@(NSUnderlineStyleSingle),
                             NSForegroundColorAttributeName:DEF_GRAY
                             };
  
  NSMutableAttributedString *attribtStr = [[NSMutableAttributedString alloc] initWithString:YTLocalizedString(@"接收不到电话?") attributes:styleDic];
  [_aboutButton setAttributedTitle:attribtStr forState:UIControlStateNormal];

  
}

@end
